<%@page import="com.surelution.projects.crm.MessageBoard"%>
<html>
<head>
	<title>浙江嘉兴加油站营销管理平台</title>
    <link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
	<style type='text/css' media='screen'>
	#login {
		margin: 5px 0px 10px 0px;
		padding: 0px;
		height:500px;
		font:18px 楷体 , arial, helvetica, sans-serif;
	}
	#title{
		text-align: center;
	}
	
	#login .leftCol{
		width: 70%;
		height: 100%;
		display:inline;
		float:left;
		background: #fff url(../images/loginPic.jpg);
	}
	
	#login .rightCol{
		width: 29.5%;
		height: 58%;
		float:right;
		display:inline;
	    background: darkblue url(../images/login.jpg)  bottom repeat-x;
	}
	
	#login .inner {
		padding-bottom: 6px;
		margin: 0px auto;
		float:right;
		width: 29.5%;
		height: 40%;
		float:right;
		display:inline;
	}

	#login .inner .fheader {
		padding: 0px;
		text-align:center;
		color: #000;
		margin:10px 10px 0px 10px;
		font-size: 20px;
		font-weight: bold;
	}

	#login .inner .cssform{
		margin:0px 0px;
		height: 100%;
		width:100%;
	    background: darkblue url(../images/login.jpg)  bottom repeat-x;

	}
	#login .inner .cssform p {
		clear: left;
		margin: 0;
		padding: 15px  0 0 80px;
	}

	#login .inner .cssform input[type='text'] {
		width: 120px;
	}

	#login .inner .cssform label {
		text-align: right;
		width: 80px;
		padding-top: 5px;
		padding-right: 5px;
		color:  #ffffff;
	}
	#login .inner .Isubmit{
		width:60px;
		height:30px;
		background: #524d53;
		color: white;
	}

	#login #remember_me_holder {
		padding-left: 120px;
	}

	#login #submit {
		margin-right: 10px;
	}

	#login #remember_me_holder label {
		float: left;
		margin-left: 0;
		text-align: left;
		width: 50px;
		display:inline;
	}

	#login .inner .login_message {
		padding: 6px 10px 10px 10px;
		color: #c33;
		text-align: center;
	}

	#login .inner .text_ {
		width: 120px;
		margin-top: 5px;
		margin-left: 10px;
	}

	#login .inner .chk {
		height: 25px;
		float:left;
	}
	
	#login .rightCol .rightBottom{
		font:24px 楷体 , arial, helvetica, sans-serif;
		text-align:center;
	}
	</style>
</head>

<body>
<div id='title'>
<img style="border: 0 none;"  src="${resource(dir:'images',file:'title_login.png')}"/>
</div>

<div id='login'>
	<div class='leftCol'>
	</div>

		<div class='inner'>
	
			<g:if test='${flash.message}'>
				<div class='login_message'>${flash.message}</div>
			</g:if>
			<form action='${postUrl}' method='POST' id='loginForm' class='cssform' autocomplete='off'>
				<p style="padding-top:30px;">
					<label for='username'><g:message code="springSecurity.login.username.label"/>:</label>
					<input type='text' class='text_' name='j_username' id='username'/>
				</p>
	
				<p>
					<label for='password'><g:message code="springSecurity.login.password.label"/>:</label>
					<input type='password' class='text_' name='j_password' id='password'/>
				</p>
	
				<p id="remember_me_holder">
					<input type='checkbox' class='chk' name='${rememberMeParameter}' id='remember_me' <g:if test='${hasCookie}'>checked='checked'</g:if>/>
					<label for='remember_me'><g:message code="springSecurity.login.remember.me.label"/></label>
					<input type='submit' id="submit" value='${message(code: "springSecurity.login.button")}' class='Isubmit'/>
				</p>
			</form>
		</div>
		<%
			params.max = Math.min(params.max ? params.int('max') : 5, 100)
			def messageBoardList = MessageBoard.createCriteria().list([max:params.max, offset:params.offset]){
			isNull("replyTo")
			eq("isPublic",true)
			order("createTime", "desc")
		}
		 %>
	<div class='rightCol' >
		<div class='rightBottom' style="padding:20px 0 0 0;"><label style="font:24px 楷体 , arial, helvetica, sans-serif;color:white;float:center;margin:20px 0 0 0px;">最新公告</label></div>
		<div>
		<table style="padding:20px 0 0 10px;color:black;">
        	<tbody>
            	<g:each in="${messageBoardList}" status="i" var="messageBoardInstance">
                 	<tr class="prop">
                         <td valign="top" align="left" style="font-family:楷体, arial, helvetica, sans-serif;text-align:left;">
                         	${i+1 }、<g:if test="${messageBoardInstance.title.size()>=6}"><label title="${messageBoardInstance.title}" >${messageBoardInstance.title.substring(0,5)}</label></g:if>
                        		<g:if test="${messageBoardInstance.title.size()<6}"><label >${messageBoardInstance.title}</label></g:if>
                         	(<label title="${messageBoardInstance.station?.name}">${messageBoardInstance.user})</label>
                         </td>

                         <td valign="top" >
                         	<g:formatDate date="${messageBoardInstance.createTime}" format="yyyy-MM-dd hh:mm"/>
                         </td>
				
                     </tr>
                     
                     <tr class="prop">
                         <td valign="top" class="name2" style="padding-left:15px;">
                          	<g:if test="${messageBoardInstance.description.size()>=20}">内容：<label title="${messageBoardInstance.description}">${messageBoardInstance.description.substring(0,20)}</label> </g:if>
                        	<g:if test="${messageBoardInstance.description.size()<20}">内容：<label>${messageBoardInstance.description}</label></g:if>
                        </td>
                     </tr>
				</g:each>
        	</tbody>
    	</table>
    	</div>
    	<div style="width:100px;height:50px;float:right;color:white;">
          	<g:link action="publicList" controller="messageBoard" >更多公告</g:link>
    	</div>
	</div>
	
	
</div>
<script type='text/javascript'>
	<!--
	(function() {
		document.forms['loginForm'].elements['j_username'].focus();
	})();
	// -->
</script>
</body>
</html>
